package cn.eclass.bean.api;

import java.util.List;

import cn.eclass.entity.CategoryEntity;

public interface ICategoryBean {
    //root should return id 0, should get all first level categories as children.

    CategoryEntity getRoot();
    //used to refresh tree in admin page.

    CategoryEntity getNewRoot();

    CategoryEntity getById(int id);

    //This method doesn't connect to db, it searches in the tree.
    //Therefore this method assumes the tree is loaded into memory.
    CategoryEntity getByIdInTree(int id);

    void getListFromTree(int catId, List<Integer> list);

    CategoryEntity getByIdIndeep(int id);

    List<CategoryEntity> getByParentId(int parentId);
//    List<CategoryEntity> getList(/*Pagination*/);

    void update(CategoryEntity category);

    CategoryEntity insert(CategoryEntity categoryEntity);

    void remove(Integer id);

    //This method load the whole tree into memory.
    void loadCatTree();
//    int getSchoolLinkItemCount();

    public CategoryEntity getByName(String search);
}
